package com.jobpass.controller;

import com.jobpass.common.data.ResultData;
import com.jobpass.common.model.Recruit;
import com.jobpass.common.service.RecruitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;

/**
 * @Author: Qning
 * @Description: 招聘类
 * @Date: 2020/7/18 18:47
 * @PackageName: com.jobpass.controller
 * @ClassName: RecruitController
 */
@Api(tags = "招聘Controller")
@RestController
@RequestMapping("student")
public class RecruitController {

    @Resource
    private RecruitService recruitService;

    /**
     *
     * @Author: Qning
     * @Description:查询所有或条件查询招聘信息
     * @Date: 21:49 2020/7/18
     * @param site
     * @param pay
     * @param post
     * @param creatTime
     * @return: com.jobpass.common.data.ResultData
     */
    @ApiOperation(value="查询所有或条件查询招聘信息")
    @GetMapping("/recruitinfo")
    public ResultData getRecruitBy(@RequestParam("site") String site,
                                   @RequestParam("pay") BigDecimal pay,
                                   @RequestParam("post") String post,
                                   @RequestParam("creatTime") String creatTime){
        System.out.println(site+"--" +pay+ "--" + post+ "--" + creatTime);
        List<Recruit> recruits = recruitService.getRecruitBy( site,  pay,  post,  creatTime);
        return ResultData.success(recruits);
    }
}
